// 这里封装的是对 mysql 的操作
const mysql = require('mysql');


function data(sql, dataArr, backFun) {
    const connection = mysql.createConnection({
        host: 'localhost',
        user: 'root',
        password: '123123',
        database: 'mes-center'
    });
    connection.connect();
    connection.query(sql, dataArr, function (err, rows, fields) {
    backFun(err, rows, fields);
    });
    connection.end();
}
module.exports = {data}
